import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询等级设置列表
export function listLevel(data) {
  return request({
    url: '/market/level/levelList',
    method: 'post',
    data: data
  })
}

// 查询等级设置详细
export function getLevel(levelId) {
  return request({
    url: '/market/level/' + parseStrEmpty(levelId),
    method: 'get'
  })
}

// 新增等级设置
export function addLevel(data) {
  return request({
    url: '/market/level',
    method: 'post',
    data: data
  })
}

// 修改等级设置
export function updateLevel(data) {
  return request({
    url: '/market/level',
    method: 'put',
    data: data
  })
}

// 删除等级设置
export function delLevel(levelId) {
  return request({
    url: '/market/level/' + levelId,
    method: 'delete'
  })
}

// 等级设置状态修改
export function changeLevelStatus(levelId, status) {
  const data = {
    levelId,
    status
  }
  return request({
    url: '/market/level/levelChangeStatus',
    method: 'put',
    data: data
  })
}
